﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL.MySQL;
using Models;
using PetaPoco;

namespace Core
{
    public class feedbackCore
    {
        private readonly feedbackDAL dal = new feedbackDAL();

        public feedbackEntity GetOne(int id)
        {
            return dal.GetOne(id) == null ? new feedbackEntity() : dal.GetOne(id);
        }
        public int Update(object obj, int ID)
        {
            return dal.Update(obj, ID);
        }
        public feedbackEntity Save(feedbackEntity model)
        {
            return dal.Save(model);
        }
        public bool Del(int id)
        {
            return dal.Del(id);
        }
        public bool Del(feedbackEntity model)
        {
            return dal.Del(model);
        }
        public List<feedbackEntity> GetList(int top, string where, string order, params object[] args)
        {
            return dal.GetPageList(1, top, where, order, args).Items;
        }
        public Page<feedbackEntity> GetPage(int page, int pagesize, string where, string order, params object[] args)
        {
            return dal.GetPageList(page, pagesize, where, order, args);
        }
    }
}
